package com.decent.ejfadmin.function.service.impl;

import com.decent.ejfadmin.function.dao.PlatFunctionDao;
import com.decent.ejfadmin.function.service.PlatConfigService;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * 平台配置管理
 *
 * @author hejunlei
 */
@Service("PlatConfigService")
public class PlatConfigServiceImpl implements PlatConfigService {
    @Autowired
    private PlatFunctionDao platFunctionDao;

    /**
     * 查询平台配置信息
     *
     * @param id 配置id
     * @return 值
     */
    @Override
    public String queryPlatConfig(int id) {

        return StringUtils.trimToEmpty(String.valueOf(platFunctionDao.queryPlatConfig(id)));
    }


    /**
     * 通过key查询平台配置
     *
     * @param key key
     * @return 返回配置
     */
    @Override
    public String queryPlatConfigBykey(String key) {
        return StringUtils.trimToEmpty(String.valueOf(platFunctionDao.queryPlatConfigBykey(key)));
    }

}
